<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Voucher</cContentSchemaName>
        <cContentXmlBrief>
          <Content action="Eonic.Web+Cart+Modules.VoucherAction" >
            <Name/>
            <StockCode/>
            <Type>Discount</Type>
            <CodeGroup></CodeGroup>
            <Prices>
              <Price currency="GBP" validGroup="all" type="sale"/>
              <Price currency="GBP" validGroup="all" type="rrp"/>
            </Prices>
            <Images>
              <img class="thumbnail"/>
            </Images>
            <ShortDescription/>
            <Body/>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail>
          <Content purchaseAction="Eonic.Web+Cart+Modules.VoucherAction">
            <Name/>
            <StockCode/>
            <Type>Discount</Type>
            <CodeGroup></CodeGroup>
            <Prices>
              <Price currency="GBP" validGroup="all" type="sale"/>
              <Price currency="GBP" validGroup="all" type="rrp"/>
            </Prices>
            <Images>
              <img class="thumbnail"/>
              <img class="display"/>
              <img class="detail"/>
            </Images>
            <ShortDescription/>
            <Body/>
          </Content>
        </cContentXmlDetail>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="cContentName" nodeset="cContentName" required="true()" type="string"/>
      <bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
      <bind id="dExpireDate" nodeset="dExpireDate" required="false()" type="string"/>
      <bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
      <bind id="cDescription" nodeset="cDescription" required="false()" type="string"/>
      <bind nodeset="cContentXmlBrief/Content">
        <bind id="cContentName" nodeset="Name" required="true()" type="string"/>
        <bind id="cContentStockCode" nodeset="StockCode" required="false()" type="string"/>
        <bind id="CodeGroup" nodeset="CodeGroup" required="true()" type="number"/>
        <bind id="cType" nodeset="Type" required="true()" type="string"/>
        <bind nodeset="Duration">
          <bind id="cUnit" nodeset="Unit" required="true()" type="string"/>
          <bind id="nLength" nodeset="Length" required="true()" type="string"/>
        </bind>
        <bind id="cPaymentUnit" nodeset="PaymentUnit" required="true()" type="string"/>
        <bind id="cContentPrice" nodeset="Prices/Price[@type='sale']" required="false()" type="format:^[-+]?[0-9]*\.?[0-9]+$"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentFullSizePicture" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
        <bind id="cContentStrap" nodeset="ShortDescription" required="false()" type="string"/>       
      </bind>
      <bind nodeset="cContentXmlDetail/Content">
        <bind id="cContentName" nodeset="Name" required="true()" type="string"/>
        <bind id="cContentStockCode" nodeset="StockCode" required="false()" type="string"/>
        <bind id="CodeGroup" nodeset="CodeGroup" required="true()" type="number"/>
        <bind id="cType" nodeset="Type" required="true()" type="string"/>
        <bind nodeset="Duration">
          <bind id="cUnit" nodeset="Unit" required="true()" type="string"/>
          <bind id="nLength" nodeset="Length" required="true()" type="string"/>
        </bind>
        <bind id="cPaymentUnit" nodeset="PaymentUnit" required="true()" type="string"/>
        <bind id="cContentPrice" nodeset="Prices/Price[@type='sale']" required="false()" type="format:^[-+]?[0-9]*\.?[0-9]+$"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentFullSizePicture" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
        <bind id="cContentStrap" nodeset="ShortDescription" required="false()" type="string"/>
      </bind>
    </bind>
  </model>
  <group ref="EditContent" class="2col">
    <label>Edit Voucher </label>
    <group class="xFormContainer">
      <group class="Content">
        <label>Settings</label>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <input bind="cDescription" class="short">
          <label>Change notes</label>
        </input>
      </group>
      <group class="Content">
        <label>Images</label>
        <input bind="cContentFullSizePicture" class="short pickImage">
          <label>Main product image</label>
          <help class="inline">
            <p>This image should generally be no larger than <b>800x600 pixels, at 72dpi.</b></p>
            <p>The main image is automatically resized for other smaller images such as thumbnails.</p>   
            <p>However if you would like a different image for the thumbnail or main product page, they can be specified below.</p>
          </help>
        </input>
        <input bind="cContentThumbnail" class="short pickImage">
          <label>Alternative thumbnail</label>
        </input>
        <input bind="cContentPicture" class="short pickImage">
          <label>Alternative picture</label>
        </input>
      </group>
      
    </group>
    <!-- End of Column 1-->
    <group ref="Content" class="xFormContainer">
      <group>
        <label>Voucher Details</label>
        <input bind="cContentName" class="long required">
          <label>Name</label>
        </input>
        <group class="inline">
        <input bind="cContentStockCode" class="short">
          <label>Stock code</label>
        </input>
          <select1 bind="CodeGroup" class="ewQuery" query="CodeGroups">
            <label>Code group</label>
            <help class="inline">The user is issued a voucher code from this code group.</help>
          </select1>
        </group>
      </group>
      <group class="inline">
        <label>Voucher Payments</label>
        <input bind="cContentPrice" class="short">
          <label>Payment amount</label>
          <help class="inline">Numeric only (e.g. 0.00)</help>
        </input>     
      </group>
      <group ref="mainContent" class="Content">
          <label>Voucher Descriptions</label>
        <textarea bind="cContentStrap" class="TextArea xhtml" rows="1">
          <label>Brief description</label>
        </textarea>
        <textarea bind="cContentBody" class="TextArea xhtml" rows="15">
          <label>Detailed Description</label>
        </textarea>
        </group>
      <group>
        <label>Notes XForms</label>
        <relatedContent type="xform" direction="1Way" search="find add" relationType="related"/>
      </group>
    </group>
  </group>
  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Voucher</label>
    </submit>
  </group>
</Content>
